package com.zkjl.protect_business.controller;

import com.zkjl.protect_business.common.ApiResponse;
import com.zkjl.protect_business.common.SystemLog;
import com.zkjl.protect_business.entity.NoticeRecord;
import com.zkjl.protect_business.service.NoticeRecordService;
import com.zkjl.protect_business.vo.NoticeRecordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/noticeRecords")
@Api(tags = {"文件通知读取记录"})
public class NoticeRecordController {

    @Autowired
    NoticeRecordService noticeRecordService;


    @ApiOperation(value = "读取记录列表", notes = "读取记录列表", httpMethod = "GET")
    @GetMapping
    @ApiImplicitParams({
            @ApiImplicitParam(name = "noticeId", value = "通知id", required = true, paramType = "query"),
            @ApiImplicitParam(name = "isRead", value = "已读 未读", required = true, paramType = "query")
    })
    @SystemLog(description = "读取文件通知记录列表")
    public ApiResponse<List<NoticeRecordVO>> list(String noticeId, String isRead) {


        List<NoticeRecordVO> list = noticeRecordService.list(noticeId, isRead);
        return ApiResponse.ofSuccess(list);
    }



}
